/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f4f7f9;
    width: 350px; /* 固定宽度 */
    min-height: 100vh;
}

.container {
    padding: 16px;
    max-width: 100%;
}

/* 顶部标题 */
.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px; /* 减少与副标题的间距 */
}

.subtitle {
    font-size: 12px;
    font-weight: 500;
    color: #e74c3c;
    display: block; /* 使其换行 */
}

/* 统一面板样式 */
.panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.panel h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

/* 主操作按钮 */
.summarize-btn {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #5A8DFF 0%, #4D76D9 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.summarize-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(90, 141, 255, 0.3);
}

.summarize-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 次要操作按钮组 */
.secondary-actions {
    display: flex;
    gap: 12px;
}

.secondary-btn {
    flex: 1;
    padding: 9px 12px;
    background: #f0f2f5;
    color: #555;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.secondary-btn:hover {
    background: #e4e6e9;
    color: #111;
}


/* 结果展示区域 */
.result-card {
    background-color: #ffffff;
    border: 1px solid #e8eaf0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px; /* 解决卡片间距问题 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.result-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #34495e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-card p {
    color: #555;
    line-height: 1.7;
}

/* "一句话总结" 的可拉伸样式 */
#mainContent {
    min-height: 4em;
    max-height: 250px;
    padding: 12px;
    border: 1px solid #e8eaf0;
    border-radius: 8px;
    color: #555;
    line-height: 1.7;
    resize: vertical; /* 只允许上下拉伸 */
    overflow: auto;
}

#keyPoints {
    min-height: 8em;
    max-height: 400px;
    overflow-y: auto;
    resize: vertical; /* 只允许上下拉伸 */
    padding: 12px;
    border: 1px solid #e8eaf0;
    border-radius: 8px;
}

#keyPoints div {
    color: #555;
    line-height: 1.7;
    margin-bottom: 12px; /* 要点之间的空行效果 */
}

#keyPoints div:last-child {
    margin-bottom: 0;
}


/* 结果区域的操作按钮 */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.action-btn {
    padding: 8px 12px;
    background: #eaf0f6;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #dce5ef;
}

/* 设置和历史记录面板 */
.setting-item {
    margin-bottom: 16px;
}

.setting-item label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.setting-item input,
.setting-item select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.setting-item input:focus,
.setting-item select:focus {
    outline: none;
    border-color: #5A8DFF;
    box-shadow: 0 0 0 3px rgba(90, 141, 255, 0.2);
}

.setting-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.primary-btn {
    flex: 1;
    padding: 10px;
    background: #5A8DFF;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.primary-btn:hover {
    background: #4D76D9;
}

.cancel-btn {
    flex: 1;
    padding: 10px;
    background: #f0f2f5;
    color: #555;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.cancel-btn:hover {
    background: #e4e6e9;
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.history-item {
    padding: 12px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background 0.2s;
}
.history-item:first-child {
    border-top: 1px solid #f0f2f5;
}

.history-item:hover {
    background: #f8f9fa;
}

.history-item-title {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.history-item-date {
    font-size: 11px;
    color: #888;
}

.history-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.setting-item label[for="autoSummarizeSwitch"] {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

#autoSummarizeSwitch {
    width: 16px;
    height: 16px;
} 